import { SpriteFrame, resources } from "cc"

class ResourceManager {
  loadRes(path: string, type = SpriteFrame) {
    return new Promise<SpriteFrame[]>((resolve, reject) => {
      resources.loadDir(path, type, function (err, assets) {
        if (err) {
          reject(err)
        }
        resolve(assets)
      })
    })
  }
}
export default new ResourceManager()
